#include <bits/stdc++.h>

using namespace std;

#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)

#define in read()
#define eb emplace_back

int read() {
	int x; scanf("%d", &x); return x;
}

using db = double;

const int N = 110;

const db eps = 1e-10;

struct ve {
	db x, y, z;
	ve(db x = 0, db y = 0, db z = 0) : x(x), y(y), z(z) { }
	db len() { return sqrt(x * x + y * y + z * z); }
	friend ve operator + (ve a, ve b) {
		return ve(a.x + b.x, a.y + b.y, a.z + b.z);
	}
	friend ve operator - (ve a, ve b) {
		return ve(a.x - b.x, a.y - b.y, a.z - b.z);
	}
	friend ve operator * (ve a, ve b) { // cha cheng
		return ve(a.y * b.z - a.z * b.y, -(a.x * b.z - a.z * b.x), a.x * b.y - a.y * b.x);
	}
	friend db operator ^ (ve a, ve b) { // dot 
		return a.x * b.x + a.y * b.y + a.z * b.z;
	}
} a[N];
	
int n;

void solve() {
	n = in; rep(i, 1, n) a[i].x = in, a[i].y = in, a[i].z = in;
	if(n <= 3) return printf("%.12lf\n", 0), void();
	db ans = 1e18;
	rep(A, 1, n) rep(B, 1, n) {
		rep(C, 1, n) rep(D, 1, n) {
			ve t = (a[B] - a[A]) * (a[D] - a[C]);
			if(t.len() < eps) continue;
			db mx = -1e18, mn = 1e18;
			rep(i, 1, n) {
				db ret = (a[i] - a[A]) ^ t;
				//cerr << ret << " ";
				mx = max(mx, ret), mn = min(mn, ret);
			}
			//cerr << " | ";
			//cerr << A << " " << B << " " << C << " " << D << " " << "!" << t.x << " " << t.y << " " << t.z << " " << mx << " " << mn << endl;
			ans = min(ans, (mx - mn) / t.len());
		}
	} if(ans > 1e16) ans = 0; printf("%.12lf\n", ans);
}

int main() {
	solve();
}
